package user

const queryUserSystemRoles = `
SELECT 
s.id sys_id,r.role_id 
FROM sso_system_info s 
left join sso_user_role r on s.id=r.sys_id and r.user_id=@user_id`

const deleteSysRoleByUserID = `
delete from sso_user_role
where user_id=@user_id`

const insertSysRoleByUserID = `
insert into sso_user_role(
	user_id,
	sys_id,
	role_id,
	enable
	)values(
	@user_id,
	@sys_id,
	@role_id,
	0)`
const resetPasswordByUserID = `
update sso_user_info t
set t.password=@password,
t.changepwd_times=t.changepwd_times+1
where t.user_id=@user_id`

const unlockUserByUserID = `
update sso_user_info t
set t.curr_failed_cnt=0,
t.last_failed_time=now()
where t.user_id=@user_id`
